#include <stdio.h>
#include "RCSwitch.h"

RCSwitch mySwitch;

bool init(int pin)
{
	if(wiringPiSetup() == -1)
		return false;
	
	mySwitch = RCSwitch();
	mySwitch.enableTransmit(pin);
	
	return true;
}

void switchOn(char* systemCode, int unitCode)
{
	mySwitch.switchOn(systemCode, unitCode);
}

void switchOff(char* systemCode, int unitCode)
{
	mySwitch.switchOff(systemCode, unitCode);
}

#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
using namespace boost::python;

BOOST_PYTHON_MODULE(_pyrcswitch)
{
	def("init", init);
	def("switchOn", init);
	def("switchOn", switchOn);
	def("switchOff", switchOff);
}

